package com.jzo2o.customer.controller.operation;

import com.jzo2o.common.model.PageResult;
import com.jzo2o.customer.model.domain.AgencyCertification;
import com.jzo2o.customer.model.domain.WorkerCertification;
import com.jzo2o.customer.model.dto.request.AgencyCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.model.dto.response.AgencyCertificationAuditResDTO;
import com.jzo2o.customer.model.dto.response.BankAccountResDTO;
import com.jzo2o.customer.model.dto.response.WorkerCertificationAuditResDTO;
import com.jzo2o.customer.service.IAgencyCertificationAuditService;
import com.jzo2o.customer.service.IAgencyCertificationService;
import com.jzo2o.customer.service.IWorkerCertificationAuditService;
import com.jzo2o.customer.service.IWorkerCertificationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author itcast
 */
@RestController("operationCertificationController")
@RequestMapping("/operation")
@Api(tags = "运营端 - 实名认证处理相关接口")
public class CertificationController {

    @Resource
    private IWorkerCertificationAuditService workerCertificationAuditService;

    @Resource
    private IAgencyCertificationAuditService agencyCertificationAuditService;
    @GetMapping("/worker-certification-audit/page")
    @ApiOperation("个人认证查询")
    public PageResult<WorkerCertificationAuditResDTO> findWorkerCertificationAuditPage(WorkerCertificationAuditPageQueryReqDTO dto) {
      return  workerCertificationAuditService.findWorkerCertificationAuditPage(dto);
    }

    @PutMapping("/worker-certification-audit/audit/{id}")
    @ApiOperation("个人认证审核")
    public void workerAuditOperation(@RequestBody WorkerCertificationAuditResDTO dto,@PathVariable(value = "id") Long auditId) {
          workerCertificationAuditService.auditOperation(dto,auditId);
    }

    @GetMapping("/agency-certification-audit/page")
    @ApiOperation("机构认证查询")
    public PageResult<AgencyCertificationAuditResDTO> findAgencyCertificationAuditPage(AgencyCertificationAuditPageQueryReqDTO dto) {
        return agencyCertificationAuditService.findAgencyCertificationAuditPage(dto);
    }


    @PutMapping("/agency-certification-audit/audit/{id}")
    @ApiOperation("机构认证审核")
    public void agencyAuditOperation(@RequestBody AgencyCertificationAuditResDTO dto,@PathVariable(value = "id") Long auditId) {
        agencyCertificationAuditService.auditOperation(dto,auditId);
    }



}
